<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>投资百科</title>
	<link rel="stylesheet" type="text/css" href="../../build/css/base.css"/>
	<link rel="stylesheet" type="text/css" href="../../build/css/main.css">
	<link rel="stylesheet" type="text/css" href="../../build/css/find.css">
	<script type="text/javascript" src="../../build/js/jquery.min.js"></script>
	<script src="../../build/public/vue.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../build/js/template.js"></script>
	<script type="text/javascript" src="../../build/js/config.js"></script>
	<script type="text/javascript" src="../../build/public/base.js"></script>
	<script type="text/javascript" src="../../build/public/vue-resource.js"></script>
	<script type="text/javascript" src="../../build/js/config.js"></script>
	<script type="text/javascript" src="../../build/js/common.js"></script>
</head>
<body>
	<div id="container" class="encyclopedias" style="padding-bottom: 50px;">
		<find-menu></find-menu>
		<div class="content-list">
			<a v-for="item in newsList" v-bind:href="item.idStr2" style="overflow:hidden;">
				<span style="width:40%;display:block;float:left;overflow:hidden;">
					<img v-bind:src="item.pictureUrl2" alt="图片加载失败" style="height:115px;width:auto;"/>
				</span>
				<p>
					<span class="title">{{item.title}}</span>						
					<span class="active" v-if="item.lab  == 'WELLCHOSEN'">{{item.lab | lab}}</span>
					<span class="lab" v-else>{{item.lab | lab}}</span>
				</p>
			</a>
		</div>
		<div class="empetDate" v-if="! newsList.length" style="display: block;">
			<span class="iconfont">&#xe602;</span>
			抱歉！没找到更多数据
		</div>
		<my-footer></my-footer>
	</div>
	<script type="text/javascript">
		var vm = new Vue({
			el:"#container",
			data:{
				newsList:[],
				page:1
			},
			mounted:function(){
				this.$nextTick(function(){
					this.init()
					refresh(this.refreshData())
				})
			},
			methods:{
				init:function(){
					this.getData()
				},
				getData:function(){
					loader.init()
					var encyclopediasId = window.localStorage.getItem('encyclopediasIdStr')
					get('/discovery/opinion/list',{
						currentPage:this.page,
						opinionCategoryId:encyclopediasId,
						deviceType:'WECHAT'
					},function(res){
						vm.newsList = vm.newsList.concat(res.data)
						for(var i=0;i<vm.newsList.length;i++){
							vm.newsList[i].pictureUrl2 = domain+vm.newsList[i].pictureUrl
							vm.newsList[i].idStr2 = 'detail.html?idStr='+vm.newsList[i].idStr
						}
						if(res.data.length < 7){
							refreshText('到底了哦！')
						}else{
							refreshText('上拉加载更多数据')
						}
						if(vm.newsList.length <7){
							refreshText('')
						}
						loader.remove()
					},function(res){
						toast(res.error)
					})
				},
				refreshData:function(){
					return function(){
						vm.page++
						vm.getData()
					}
				}
			},
			filters:{
				lab:function(type){
					if(type == 'HOT'){
						return '热门'
					}else if(type == 'WELLCHOSEN'){
						return '精选'
					}else if(type == 'LATED'){
						return '最新'
					}
				},
				statistics:function(number){
					if(number>1000){
						return '999+'
					}
				}
			}
			
			
			
		})
		
	</script>
</body>
</html>